JBoss Community Archive (Read Only)

Infinispan 5.1

How does Infinispan support explicit eager locking?

Infinispan cache interface exposes lock API that allows cache users to explicitly lock set of cache keys eagerly during a transaction. Lock call attempts to lock specified cache keys across all cluster nodes and it either succeeds or fails. All locks are released during commit or rollback phase.

Consider a transaction running on one of the cache nodes:

 
   tx.begin() 
   cache.lock(K)    // acquire cluster wide lock on K
   cache.put(K,V5)  // guaranteed to succeed 
   tx.commit()      // releases locks

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 09:17:57 UTC, last content change 2011-07-18 12:46:13 UTC.